package view.server;

import java.awt.Color;
import java.awt.Component;

import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.ListCellRenderer;

import controller.Controller;

import model.Job;
import model.LabelText;

public class EditTextFieldsPanelRenderer extends JLabel implements
		ListCellRenderer {

	public EditTextFieldsPanelRenderer(Controller controller) {
	}

	private static final long serialVersionUID = 1L;

	@Override
	public Component getListCellRendererComponent(JList list,
			Object value, int index, boolean isSelected, boolean cellHasFocus) {

		LabelText text = (LabelText) value;
		setText(" " + text.getName());
		
		if (!isSelected) {
			setForeground(Color.BLACK);
			setBackground(Color.WHITE);
		} else {
			setForeground(Color.WHITE);
			setBackground(new Color(57, 105, 138));
		}
		
		setOpaque(true);
		return this;
	}

}
